﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ProgrammingEducationSystem.Models
{
    //学生与班级连接表
    public class StuAndClass
    {
        public Guid Id { get; set; }

        [Required(ErrorMessage = "班级Id不可为空")]
        [ForeignKey(nameof(Class))]  
        public Guid ClassId { get; set; }
        public Class @class { get; set; }

        [Required(ErrorMessage = "学生Id不可为空")]
        [ForeignKey(nameof(User))]
        public string StudentId { get; set; }
        public User student { get; set; }
        
        public DateTime AddTime { get; set; } = DateTime.UtcNow;
    }
}
